package com.ruoyi.system.service.impl;

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SeatcallMapper;
import com.ruoyi.system.domain.SeatCall;
import com.ruoyi.system.service.ISeatcallService;
import com.ruoyi.common.core.text.Convert;

/**
 * 对讲记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-17
 */
@Service
public class SeatcallServiceImpl implements ISeatcallService 
{
    @Autowired
    private SeatcallMapper seatcallMapper;

    /**
     * 查询对讲记录
     * 
     * @param gbLaneId 对讲记录主键
     * @return 对讲记录
     */
    @Override
    public SeatCall selectSeatcallByGbLaneId(String gbLaneId)
    {
        return seatcallMapper.selectSeatcallByGbLaneId(gbLaneId);
    }

    /**
     * 查询对讲记录列表
     * 
     * @param seatcall 对讲记录
     * @return 对讲记录
     */
    @Override
    public List<SeatCall> selectSeatcallList(SeatCall seatcall)
    {
        return seatcallMapper.selectSeatcallList(seatcall);
    }

    @Override
    public Set<String> getExistingTradeIds(String tableName) {

        return seatcallMapper.selectExistingTradeIds(tableName);
    }

    /**
     * 新增对讲记录
     * 
     * @param seatcall 对讲记录
     * @return 结果
     */
    @Override
    public int insertSeatcall(SeatCall seatcall)
    {
        seatcall.setCreateTime(DateUtils.getNowDate());
        return seatcallMapper.insertSeatcall(seatcall);
    }

    /**
     * 修改对讲记录
     * 
     * @param seatcall 对讲记录
     * @return 结果
     */
    @Override
    public int updateSeatcall(SeatCall seatcall)
    {
        return seatcallMapper.updateSeatcall(seatcall);
    }

    /**
     * 批量删除对讲记录
     * 
     * @param gbLaneIds 需要删除的对讲记录主键
     * @return 结果
     */
    @Override
    public int deleteSeatcallByGbLaneIds(String gbLaneIds)
    {
        return seatcallMapper.deleteSeatcallByGbLaneIds(Convert.toStrArray(gbLaneIds));
    }

    /**
     * 删除对讲记录信息
     * 
     * @param gbLaneId 对讲记录主键
     * @return 结果
     */
    @Override
    public int deleteSeatcallByGbLaneId(String gbLaneId)
    {
        return seatcallMapper.deleteSeatcallByGbLaneId(gbLaneId);
    }
}
